<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button>发送请求</button>
<button>取消请求</button>
<script>
    let xhr = null
    document.getElementsByTagName('button')[0].addEventListener('click', function () {
        xhr = new XMLHttpRequest()
        xhr.open('post', 'http://127.0.0.1:8000/network')
        xhr.send()
    })
    document.getElementsByTagName('button')[1].addEventListener('click', function () {
        xhr.abort()
    })
</script>
</body>
</html>